#ifndef EMBRYO_INDIVIDUAL_H
#define EMBRYO_INDIVIDUAL_H

#include <cstddef>

#include "../Individual.h"
using GA::Individual;

namespace GA {

class EmbryoEvaluator;
class EmbryoGenome;

/* embryo individual */
class EmbryoIndividual : public Individual {
public:
	/* static new random */
	static EmbryoIndividual* newRandom(EmbryoEvaluator& evaluator);

	/* new/delete, for safe delition accross libraries */
	static void* operator new(size_t size);
	static void  operator delete(void* memory);

	/* ctors */
	EmbryoIndividual(EmbryoGenome* genome, EmbryoEvaluator& evaluator);
	EmbryoIndividual(EmbryoIndividual const& individual);

	/* dtor */
	~EmbryoIndividual();

	/* copy */
	Individual* copy() const;

	/* genome */
	const EmbryoGenome& getGenome() const;

	/* fitness */
	double getFitness() const;

	/* mate */
	Individual* mate(Individual const& individual) const;

	/* evaluate */
	void evaluate();

	/* > */
	bool operator>(Individual const& individual) const;

//	/* toString */
//	std::string toString() const;

private:
	EmbryoGenome*    _genome;    /* genome    */
	EmbryoEvaluator& _evaluator; /* evaluator */

	double _fitness;   /* fitness */
	bool   _evaluated; /* evaluated ? */
};

} // GA

#endif	// EMBRYO_INDIVIDUAL_H

